﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title></title>
        <link type="text/css" rel="stylesheet" media="all" href="../styles/global.css" />
        <link type="text/css" rel="stylesheet" media="all" href="../styles/global_color.css" /> 
    </head>
    <body onload="initialYearAndMonth();">
        <!--Logo区域开始-->
        <div id="header">
            <img src="../images/logo.png" alt="logo" class="left"/>
            <a href="/logout">[退出]</a>
        </div>
        <!--Logo区域结束-->
        <!--导航区域开始-->
        <div id="navi">                        
            <ul id="menu">
                <li><a href="/index" class="index_on"></a></li>
                <li id="lia1"><a href="/role_list" class="role_off"></a></li>
                <li id="lia2"><a href="/admin_list" class="admin_off"></a></li>
                <li id="lia3"><a href="/fee_list" class="fee_off"></a></li>
                <li id="lia4"><a href="/account_list" class="account_off"></a></li>
                <li id="lia5"><a href="/service_list" class="service_off"></a></li>
                <li id="lia6"><a href="/bill_list" class="bill_off"></a></li>
                <li id="lia7"><a href="/report_list" class="report_off"></a></li>
                <li><a href="/userInfo" class="information_off"></a></li>
                <li><a href="/userModifyPwd" class="password_off"></a></li>
            </ul>            
        </div>
        <!--导航区域结束-->
        <!--主要区域开始-->
        <div id="main">
            <form action="" method="">
                <!--查询-->
                <div class="search_add">                        
                    <div>账务账号：<span class="readonly width70">admin1</span></div>                            
                    <div>身份证：<span class="readonly width150">230101111111111111</span></div>
                    <div>姓名：<span class="readonly width70">张三</span></div>
                    <div>计费时间：<span class="readonly width70">2013年8月</span></div>
                    <div>总费用：<span class="readonly width70">34.78</span></div>
                    <input type="button" value="返回" class="btn_add" onclick="location.href='bill_list.html';" />
                </div>  
                <!--数据区域：用表格展示数据-->     
                <div id="data">            
                    <table id="datalist">
                        <tr>
                            <th class="width70">账单明细ID</th>
                            <th class="width150">OS 账号</th>
                            <th class="width150">服务器 IP</th>
                            <th class="width70">账务账号ID</th>
                        </tr>
                    </table>
                </div>
                <!--分页-->
                <div id="pages">
        	        <a href="#">上一页</a>
                    <a href="#" class="current_page">1</a>
                    <a href="#">2</a>
                    <a href="#">3</a>
                    <a href="#">4</a>
                    <a href="#">5</a>
                    <a href="#">下一页</a>
                </div>                    
            </form>
        </div>
        <!--主要区域结束-->
        <div id="footer">
            <p>[源自北美的技术，最优秀的师资，最真实的企业环境，最适用的实战项目]</p>
            <p>版权所有(C)云科技有限公司 </p>
        </div>
    </body>
    <script src="/js/jquery-3.2.1.js"></script>
    <script>
        urlinfo = window.location.href; //获取当前页面的url
        len = urlinfo.length;//获取url的长度
        offset = urlinfo.indexOf("?");//设置参数字符串开始的位置
        parmarinfo = urlinfo.substr(offset, len)//取出参数字符串 这里会获得类似“id=1”这样的字符串
        params = parmarinfo.split("=");//对获得的参数字符串按照“=”进行分割
        id = params[1];//得到参数值
        name = params[0];//得到参数名字
        show();
        getData();
        function show() {

            $.ajax({
                url: "/selectAllModules",
                type: "post",
                success: function (result) {

                    if (result.indexOf("角色管理") == -1) {
                        document.getElementById("lia1").style.display = "none"
                    }
                    if (result.indexOf("管理员") == -1) {
                        document.getElementById("lia2").style.display = "none"
                    }
                    if (result.indexOf("资费管理") == -1) {
                        document.getElementById("lia3").style.display = "none"
                    }
                    if (result.indexOf("账务账号") == -1) {
                        document.getElementById("lia4").style.display = "none"
                    }
                    if (result.indexOf("业务账号") ==-1) {
                        document.getElementById("lia5").style.display = "none"
                    }
                    if (result.indexOf("账单管理") ==-1) {
                        document.getElementById("lia6").style.display = "none"
                    }
                    if (result.indexOf("报表") == -1) {
                        document.getElementById("lia7").style.display = "none"
                    }


                }

            });
        }
        function getData (){
            $.ajax({
                url: "getAllBillById",
                type: "get",
                data:{
                    id: id
                },
                success: function (result) {

                        var tr = $("<tr></tr>");
                        var zdId = $("<td></td>").text(result.serviceId);
                        var os = $("<td></td>").text(result.osUsername);
                        var ip = $("<td></td>").text(result.unixHost);
                        var zwzh = $("<td></td>").text(result.account.recommenderId);
                        tr.append(zdId).append(os).append(ip).append(zwzh).append(zwzh);
                        $("#datalist").append(tr);
                }
            })
        }
    </script>
</html>
